Page({

  /**
   * 页面的初始数据
   */
  data: {
    currentNavIndex:0,
    navList:[],
    videoResult:[],
    musicUrl:"",
    swiperList:[
      "../../images/1.jpg",
      "../../images/2.jpg",
      "../../images/3.jpg",
      "../../images/4.jpg",
      "../../images/5.jpg",
    ]
  },
  //导航分类
  getNavlist(){
    // this.navList=["首页","音乐","舞蹈","综艺","动漫","鬼畜","电影","广告"]
    let that = this;
    wx.request({
      url: 'https://autumnfish.cn/playlist/catlist',
      success(res){
        that.setData({
          navList: res.data.sub
        })
      }
    })
  },
  //导航变色
  activeNav(e){
    this.setData({
    currentNavIndex: e.target.dataset.index
    })
  },
  //详细
  getIndex(){
    let that = this;
    wx.request({
      url: 'https://autumnfish.cn/playlist/detail?id=574704746',
      success(res){
        // console.log(res.data.playlist.tracks)
        that.setData({
          videoResult: res.data.playlist.tracks
        })
      
      }
    })
  },
 


  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    this.getNavlist();
    this.getIndex();

  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {
    
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
    
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {
    
  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {
    
  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
    
  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
    
  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {
    
  }
})